import time
import pyautogui
from common_ai_img.env import ai_object_detect_env
from common_ai_img import AIButton, Icon, OcrText
from common_ai_img.ui_control.component import Anchor

ai_object_detect_env.PRODUCTLINE = "InnovativeProducts"
ai_object_detect_env.SOFTWARE = "FS7"
ai_object_detect_env.SOFTWARE_WIN_ALIAS = "FreeScan Omni"
ai_object_detect_env.LANGUAGE = "English"
ai_object_detect_env.WINDOWS_TO_TOP = True
#ai_object_detect_env.TSFOLDER = "软件ts文件夹"
#ai_object_detect_env.OUTPUT_DIR = "运行过程中图片的存储路径"
#ai_object_detect_env.MOUSE_RESET = True


# new_project_group_button = AIButton(OcrText("New Project Group"))
# new_project_group_button.click()
#
# time.sleep(3)
# laser_mode = AIButton(OcrText("Laser Mode"))
# laser_mode.click()
#
# time.sleep(3)
# comfirm_button = AIButton(OcrText("Confirm"))
# comfirm_button.click()

#
# a = AIButton(OcrText("scan mesh"))
# a.click()
#
# pyautogui.scroll(-1000)
#
a = AIButton(Icon("close"))
a.click()


# from pathlib import Path
#
# def rename(path):
#
#     floder = Path(path)
#     for file in floder.iterdir():
#         name = file.name
#         list = name.split("_")
#         num = int(list[1]) - 5465
#         new_name = path + '\\' + f'{list[0]}_{num}_{list[2]}'
#         file.rename(new_name)
#
# rename(r'C:\Users\XL-TYDQ2847\Desktop\SaveImageBin')
